import Vue from 'vue'
import Vuex from 'vuex'

import { api, $api } from './api'

var querystring = require('querystring');
var remote = false
const HOST=remote?"http://119.27.189.70:8084":"http://localhost:8084"


Vue.use(Vuex)

const main = {
  state: {
    
  },
  mutations: {
    
  },
  actions: {
    orderAdd(context, payload) {
      return api(`${HOST}/api/order`,{type:'post',params:payload});
    },
    numberPool(context, payload) {
      return api(`${HOST}/api/number-pool`);
    },
    orderSearch(context,payload){
      return api(`${HOST}/api/order-search`,{params:payload})
    }
  }
}
const order98 = {
  state: {
    
  },
  mutations: {
    
  },
  actions: {
    occupyNumber(context, payload) {
      return api(`${HOST}/api/order98/occupyNumber`,{type:'post',params:payload});
    },
    checkCustInfo(context, payload) {
      return api(`${HOST}/api/order98/checkCustInfo`,{type:'post',params:payload});
    },
    buyNumCommon(context, payload) {
      return api(`${HOST}/api/order98/BuyNumCommon`,{type:'post',params:payload});
    },
   
  }
}


const store = new Vuex.Store({
  modules: {
    main,
    order98
  }
})

export default store